package com.kwok.openplatform.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kwok.openplatform.dao.AppDao;
import com.kwok.openplatform.entity.App;
import com.kwok.openplatform.service.AppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 应用表(App)表服务实现类
 *
 * @author Kwok
 * @since 2024-07-21 18:31:38
 */
@Service
public class AppServiceImpl implements AppService {

    @Autowired
    private AppDao appDao;

    @Override
    public PageInfo<App> queryApps(Integer page, Integer limit, App app) {
        PageHelper.startPage(page,limit);
        List<App> list = appDao.selectApps(app);
        PageInfo<App> pageInfo = new PageInfo<App>(list);
        return pageInfo;
    }

    @Override
    public Integer saveApp(App app) {
        return appDao.insertApp(app);
    }

    @Override
    public Integer updateAppById(App app) {
        return appDao.updateAppById(app);
    }

    @Override
    public Integer removeAppById(Integer id) {
        return appDao.deleteAppById(id);
    }

    @Override
    public Integer batchRemoveAppById(Integer[] ids) {
        return appDao.batchDeleteAppById(ids);
    }

}

